﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Silverlight.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PlottingBasics.Axis;
using System.Linq;

namespace t_PlottingBasics
{
    /// <summary>
    /// Test the simple linear axis
    /// </summary>
    [TestClass]
    public class t_LinearAxis
    {
        [TestMethod]
        public void TestCTor()
        {
            LinearAxis la = new LinearAxis(50, 0.0, 10.0);
        }

        [TestMethod]
        public void TestBinning()
        {
            LinearAxis la = new LinearAxis(50, 0.0, 10.0);
            Assert.AreEqual(51, la.Count(), "Should be bins+1 different numbers on the axis!");
        }

        [TestMethod]
        public void TestValues()
        {
            LinearAxis ls = new LinearAxis(50, 0.0, 10.0);
            Assert.AreEqual(0.0, ls.Min(), "Min is wrong");
            Assert.IsTrue(Math.Abs(10.0 - ls.Max()) < 0.0001, "Max is wrong");
        }
    }
}